//
//  CinemaTableViewCell.m
//  DouBan-Cinema
//
//  Created by lanou3g on 15/11/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "CinemaTableViewCell.h"
#import "CinemaModel.h"

@interface CinemaTableViewCell ()




@end

@implementation CinemaTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self allViews];
    }
    return self;
}

- (void)setCinema:(CinemaModel *)cinema
{
    self.cinemaNameLabel.text = cinema.cinemaName;
    self.addressLabel.text = cinema.address;
    self.telephoneLabel.text = cinema.telephone;

}

- (void)allViews
{
    self.imageViewCell = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bg_eventlistcell@2x"]];
    self.imageViewCell.frame = CGRectMake(10, 10, 355, 130);
    [self.contentView addSubview:self.imageViewCell];
    
    self.cinemaNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10,5,335,35)];
    self.cinemaNameLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];
//    self.cinemaNameLabel.backgroundColor = [UIColor redColor];
    [self.imageViewCell addSubview:self.cinemaNameLabel];
    
    self.addressLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.cinemaNameLabel.frame.origin.x, self.cinemaNameLabel.frame.origin.y+40, self.cinemaNameLabel.frame.size.width, self.cinemaNameLabel.frame.size.height)];
    self.addressLabel.numberOfLines = 0;
//    self.addressLabel.backgroundColor = [UIColor yellowColor];
    [self.imageViewCell addSubview:self.addressLabel];
    
    self.telephoneLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.addressLabel.frame.origin.x, self.addressLabel.frame.origin.y + 40, self.addressLabel.frame.size.width, 35)];
    self.telephoneLabel.numberOfLines = 0;
//    self.telephoneLabel.backgroundColor = [UIColor purpleColor];
    [self.imageViewCell addSubview:self.telephoneLabel];
}














- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
